package ro.imc.custom.wifipassword;

import java.util.ArrayList;
import java.util.List;

import ro.imc.wifipassword.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class PasswordListAdapter extends ArrayAdapter<String> {
	private Context mContext;
	private List<String> mList = new ArrayList<String>();
	public PasswordListAdapter(Context context, int resource,
			List<String> objects) {
		
		super(context, resource, objects);
		mContext = context;
		mList = objects;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		super.getView(position, convertView, parent);
		if(convertView == null){
			LayoutInflater inflater = (LayoutInflater)mContext.getSystemService
				      (Context.LAYOUT_INFLATER_SERVICE);
			convertView = inflater.inflate(R.layout.network_list_items, parent);
		} else {
			TextView passwordView = (TextView)convertView.findViewById(R.id.passwordView);
			passwordView.setText(mList.get(position));
		}
		return convertView;
		
		
	}

}
